package com.sgb.kjwl.view.ui.adapter.self.goods;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.MemberPriceEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class MemberPriceDetailsAdapter extends BaseRecycleAdapter<MemberPriceEntity.MemberPriceSkuDetail> {

    private TextView line;

    public MemberPriceDetailsAdapter(Context context, List<MemberPriceEntity.MemberPriceSkuDetail> datas) {
        super(context, R.layout.item_member_price_details, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final MemberPriceEntity.MemberPriceSkuDetail entity) {
        holder.setBinding(BR.viewModel, entity);
        line = holder.getView(R.id.line);
        if (holder.getIndex_position() == datas.size() - 1) {
            line.setVisibility(View.INVISIBLE);
        }
    }
}
